package cn.powerone.scm.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import cn.powerone.common.annotation.Excel;
import cn.powerone.common.core.domain.BaseEntity;

/**
 * 售后工单对象 scm_defect_ticket
 * 
 * @author PowerOne
 * @date 2025-08-22
 */
@Setter
@Getter
public class ScmDefectTicket extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long id;

    /** 项目id */
    @Excel(name = "项目id")
    private Long projectId;

    /** 客户订单ID */
    @Excel(name = "客户订单ID")
    private Long customerOrderId;

    /** 客户订单编号 */
    @Excel(name = "客户订单编号")
    private String customerOrderCode;

    /** 售后工单ID */
    @Excel(name = "售后工单ID")
    private String ticketCode;

    /** 供应商订单ID */
    @Excel(name = "供应商订单ID")
    private Long supplierOrderId;

    /** 供应商订单编号 */
    @Excel(name = "供应商订单编号")
    private String supplierOrderCode;

    /** 不良发生日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "不良发生日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date defectDate;

    /** 状态|0:-,1:待处理,2:处理中,3:处理完成,4:处理失败 */
    @Excel(name = "状态|0:-,1:待处理,2:处理中,3:处理完成,4:处理失败")
    private Long status;

    /** 处理人ID */
    @Excel(name = "处理人ID")
    private Long userId;

    /** 处理人 */
    @Excel(name = "处理人")
    private String userName;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("projectId", getProjectId())
            .append("customerOrderId", getCustomerOrderId())
            .append("customerOrderCode", getCustomerOrderCode())
            .append("ticketCode", getTicketCode())
            .append("supplierOrderId", getSupplierOrderId())
            .append("supplierOrderCode", getSupplierOrderCode())
            .append("defectDate", getDefectDate())
            .append("status", getStatus())
            .append("userId", getUserId())
            .append("userName", getUserName())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
